# get
# 1.导入爬虫的请求模块 requests
# 导入request模块的全部功能
import requests
# 2.确定目标
url = "https://www.baidu.com/"
# 浏览器上访问百度使用什么请求过程：  get
# 3.发送网络请求并接收响应
response = requests.get(url)  # 返回响应对象
# 4.处理数据并入库
print(response)

# get添加数据用params
import requests
url = "https://httpbin.org/get"
data = {
    'name':'germey',
    'age':22
}
response = requests.get(url,params=data)
print(response.text)

# post
import requests
url = "https://httpbin.org/get"
response = requests.post(url)
print(response.text)


